package com.oyo.common.enums;

/**
 * 删除类型
 */
public enum DeleteType {
    NORMAL(0, "正常"),
    DELETED(1, "已删除");

    Integer code;
    String name;

    DeleteType(Integer code, String name) {
        this.code = code;
        this.name = name;
    }

    public Integer getCode() {
        return code;
    }

    public String getName() {
        return name;
    }

    public static String fromCode(Integer code) {
        DeleteType[] types = values();
        for (DeleteType type : types) {
            if (type.getCode().equals(code)) {
                return type.getName();
            }
        }
        return null;
    }
}
